﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="CreateOrderApp.aspx.cs" Inherits="Manager_OrderApp_CreateOrderApp" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
    <title>Chi tiet don dat hang</title>
    <link href="../../Pub/Css/AdminStyles.css" rel="stylesheet" type="text/css" />
</head>
<body>
    <form id="form1" runat="server">
        <table border="0" cellpadding="0" cellspacing="0" id="tblBodyMain" style="width: 100%">
            <tr>
                <td>
                    <table style="margin-left: 0px; width: 100%; border-collapse: collapse" class="tbl_Comon-Search"
                        bordercolor="#407db3" cellspacing="2" cellpadding="2" width="100%" border="1">
                        <tbody>
                            <tr>
                                <td style="width: 4%" valign="middle" nowrap align="center" rowspan="2">
                                    <asp:Button ID="btnSearch" OnClick="btnSearch_Click" runat="server" Width="80px"
                                        Text="Tìm kiếm" CssClass="cssButton"></asp:Button><br />
                                    <asp:Button ID="btnClear" runat="server" CssClass="cssButton" OnClick="btnClear_Click"
                                        Text="Hủy bỏ" Width="80px" /></td>
                                <td style="width: 10%; white-space: nowrap" class="td_Title" nowrap>
                                    <asp:Label ID="Label1" runat="server" Text="Tên sản phẩm" CssClass="lbl_Common-Search"></asp:Label></td>
                                <td class="td_Control" nowrap>
                                    <asp:TextBox ID="txtTenSP" onkeyup="fnLoadData()" runat="server" Width="98%" CssClass="txt_Product"
                                        Height="20px"></asp:TextBox></td>
                                <td style="width: 10%; white-space: nowrap" class="td_Title" nowrap>
                                    <asp:Label ID="Label2" runat="server" Text="Chủ đề" CssClass="lbl_Common-Search"></asp:Label></td>
                                <td class="td_Control" nowrap>
                                    <asp:DropDownList ID="ddlChuDe" runat="server" OnSelectedIndexChanged="ddlChuDe_SelectedIndexChanged"
                                        AutoPostBack="True">
                                    </asp:DropDownList></td>
                            </tr>
                            <tr>
                                <td style="width: 10%; white-space: nowrap" class="td_Title" nowrap>
                                    <asp:Label ID="Label4" runat="server" Text="Kho" CssClass="lbl_Common-Search"></asp:Label></td>
                                <td class="td_Control" nowrap>
                                    <asp:DropDownList ID="ddlStore" runat="server">
                                    </asp:DropDownList></td>
                                <td style="width: 10%; white-space: nowrap" class="td_Title" nowrap>
                                    <asp:Label ID="Label3" runat="server" Text="Thể loại" CssClass="lbl_Common-Search"></asp:Label></td>
                                <td class="td_Control" nowrap>
                                    <asp:DropDownList ID="ddlTheLoai" runat="server">
                                    </asp:DropDownList></td>
                            </tr>
                            <tr>
                                <td align="right" colspan="5" nowrap="nowrap">
                                    <asp:Button ID="btnAddBasket" runat="server" OnClick="btnAddBasket_Click" Text="Thêm giỏ hàng"
                                        CssClass="cssButton" /></td>
                            </tr>
                        </tbody>
                    </table>
                    <div id="divMaster" runat="server">
                        <asp:GridView ID="grv_Master" runat="server" AutoGenerateColumns="False" BorderColor="#407db3"
                            CellPadding="2" DataKeyNames="PDID" Width="100%" OnRowDataBound="grv_Master_RowDataBound" AllowPaging="True">
                            <Columns>
                                <asp:TemplateField>
                                    <HeaderTemplate>
                                        <asp:Label ID="Label1" runat="server" Text="Chọn"></asp:Label>
                                    </HeaderTemplate>
                                    <ItemTemplate>
                                        <input type="checkbox" id="chkShowMK" runat="server" />
                                    </ItemTemplate>
                                    <ItemStyle CssClass="cssBorderGrv" HorizontalAlign="Center" />
                                    <HeaderStyle CssClass="cssBorderGrv" HorizontalAlign="Center" VerticalAlign="Middle"
                                        Wrap="False" />
                                </asp:TemplateField>
                                <asp:TemplateField>
                                    <HeaderTemplate>
                                        Tên sản phẩm
                                    </HeaderTemplate>
                                    <ItemTemplate>
                                        <asp:Label ID="Label1" runat="server" Text='<%# DataBinder.Eval(Container.DataItem,"PDName") %>'></asp:Label>
                                    </ItemTemplate>
                                    <ItemStyle CssClass="cssBorderGrv" HorizontalAlign="Left" VerticalAlign="Middle"
                                        Width="95%" />
                                    <HeaderStyle CssClass="cssBorderGrv" HorizontalAlign="Left" VerticalAlign="Middle" />
                                </asp:TemplateField>
                                <asp:TemplateField>
                                    <HeaderTemplate>
                                        Tỉ giá
                                    </HeaderTemplate>
                                    <ItemTemplate>
                                        <asp:Label ID="Label4" runat="server" Text='<%# DataBinder.Eval(Container.DataItem,"Rate") %>'></asp:Label>
                                    </ItemTemplate>
                                    <ItemStyle CssClass="cssBorderGrv" HorizontalAlign="Left" VerticalAlign="Middle"
                                        Width="95%" />
                                    <HeaderStyle CssClass="cssBorderGrv" HorizontalAlign="Left" VerticalAlign="Middle" />
                                </asp:TemplateField>
                                <asp:TemplateField>
                                    <HeaderTemplate>
                                        Số lượng
                                    </HeaderTemplate>
                                    <ItemTemplate>
                                        <input type="text" value="1" id="txtQuantity" runat="server" class="txt_Product"
                                            style="width: 50px" />
                                    </ItemTemplate>
                                    <ItemStyle CssClass="cssBorderGrv" HorizontalAlign="Left" VerticalAlign="Middle"
                                        Width="95%" />
                                    <HeaderStyle CssClass="cssBorderGrv" HorizontalAlign="Left" VerticalAlign="Middle" />
                                </asp:TemplateField>
                            </Columns>
                            <RowStyle CssClass="gvRowStyle" />
                            <AlternatingRowStyle CssClass="gvAlternatingRowStyle" />
                            <HeaderStyle CssClass="gvHeader" VerticalAlign="Middle" Wrap="False" />
                        </asp:GridView>
                        
                    </div>
                </td>
            </tr>
        </table>
    </form>

    <script language="javascript" type="text/javascript">
    
     try
    {
             var tbl=document.getElementById("tblBodyMain"); 
             parent.fnFullFrame(tbl.clientHeight+150);
              parent.document.body.scrollTop=0;
              parent.document.documentElement.scrollTop=0;
          
    }
    catch(e){}
    
    function fnLoadData()
    {   
        var txtTenSP=document.getElementById("<%= txtTenSP.ClientID %>");
        var ddlChuDe=document.getElementById("<%= ddlChuDe.ClientID %>");   
        var ddlStore=document.getElementById("<%= ddlStore.ClientID %>"); 
        var ddlTheLoai=document.getElementById("<%= ddlTheLoai.ClientID %>"); 
        Manager_OrderApp_CreateOrderApp.AjaxGetPD(txtTenSP.value,ddlChuDe.value,ddlTheLoai.value,ddlStore.value,CallBack_LoadData)
    }
    function CallBack_LoadData(res)
    {
        if(res!=null)
        {
            var ds=res.value;
          
            if(ds!=null && ds!="")
			{	
			     var divMaster=document.getElementById("divMaster") ;
			    divMaster.innerHTML=ds;
			}	
        }
    }
    </script>
